﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ex04.Menus.Test
{
    using Ex04.Menus.Interfaces;
    
    public static class InterfacesTester
    {
        public static void DemonstrateInterfacesMenu()
        {
            MainMenu mainMenu = buildInterfacesMenu();
            mainMenu.Show();
        }

        private static MainMenu buildInterfacesMenu()
        {
            MainMenu mainMenu = new MainMenu();
            mainMenu.MainItemsCollection.Title = "*** Main Menu - Interfaces ***";

            mainMenu.Add(
                new SubMenu("Amazing ASCII art - Sub menu")
                .Add(new ActionItem("Birthday", new Examples.HappyBirthday()))
                .Add(new ActionItem("Paradox", new Examples.Paradox()))
                .Add(new ActionItem("Monkey", new Examples.Monkey())));

            mainMenu.Add(new ActionItem("Calculate Factorial", new Examples.Factorial()));

            mainMenu.Add(
                new SubMenu("Math Functions")
                .Add(new SubMenu("Trigonometric functions")
                    .Add(new ActionItem("Sin(x)", new Examples.Sin()))
                    .Add(new ActionItem("Cos(x)", new Examples.Cos())))
                .Add(new ActionItem("x^0.5", new Examples.SquareRoot())));

            mainMenu.Add(new ActionItem("Factorial second edition", new Examples.Factorial()));

            return mainMenu;
        }
    }
}
